package cn.kgc.base.entity;

import java.util.Date;
import java.io.Serializable;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.*;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonFormat;

/**
 * (SysLog)表实体类
 *
 * @author makejava
 * @since 2022-11-28 10:51:32
 */
@Setter
@Getter
@AllArgsConstructor
@NoArgsConstructor
@Builder
@TableName(value = "sys_log")
@SuppressWarnings("serial")
@JsonInclude(value = JsonInclude.Include.NON_NULL)
@ToString
public class SysLog extends Model<SysLog> implements Serializable {

    @TableId(type = IdType.AUTO)
    private Long id; //主键


    /**
     * 日志类型:0 登陆日志 1 操作日志 2 定时任务
     **/
    @TableField(value = "log_type")
    private Integer logType;


    /**
     * 模块名
     **/
    @TableField(value = "moudulename")
    private String moudulename;


    /**
     * 操作内容
     **/
    @TableField(value = "log_content")
    private String logContent;


    /**
     * 操作类型: 1查询，2添加，3修改，4删除
     **/
    @TableField(value = "operate_type")
    private Integer operateType;


    /**
     * 用户ID
     **/
    @TableField(value = "user_id")
    private Long userId;


    /**
     * 用户名
     **/
    @TableField(value = "user_name")
    private String userName;


    /**
     * 方法名
     **/
    @TableField(value = "method")
    private String method;


    /**
     * 请求地址
     **/
    @TableField(value = "request_url")
    private String requestUrl;


    /**
     * 消耗时间
     **/
    @TableField(value = "cost_time")
    private Long costTime;


    @TableField(value = "creationdate", fill = FieldFill.INSERT)
    @JsonIgnore
    private Date creationdate; //创建时间


    @TableField(value = "modifydate", fill = FieldFill.UPDATE)
    @JsonIgnore
    private Date modifydate; //修改时间


    @TableLogic
    @JsonIgnore
    @TableField(fill = FieldFill.INSERT)
    private int deleted;  //逻辑删除标志


    @Version
    private int version;   //版本


}
